import java.util.concurrent.TimeUnit;

public class Bean {

    private volatile int a;

    public synchronized int getA() {
        return a;
    }

    public synchronized void setA(int a) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.a = a;
    }

}
